/**
 * 
 */
package com.feeyin.radar.crm.model;

/**
 * @author E547415
 *
 */
public class CodeStore 
{
	private String id;
	private String type;
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	public String getNextId()
	{
		String temp = "1";
		byte[] by = id.getBytes();
		for(int i=0; i < by.length; i++)
		{
			if(by[i] != 0)
			{
				temp = id.substring(i);
				temp = Integer.parseInt(temp) + 1 + "";		
				break;
			}				
		}
		
		if(temp.length() == 1)
			return "0000"+temp;
		if(temp.length() == 2)
			return "000"+temp;
		if(temp.length() == 3)
			return "00"+temp;
		if(temp.length() == 4)
			return "0"+temp;
		if(temp.length() == 5)
			return temp;
		
		return id;
	}
	
	public static void main(String[] arg)
	{
		CodeStore cs = new CodeStore();
		cs.setId("00001");
		System.out.println(cs.getNextId());
	}

}
